// by: 陈同学
#include<iostream>
using namespace std;
void sort(int* p,int n);
void sort(float* p,int n);
void sort(double* p,int n);
int main()
{
    cout<<"Please which kind number you want to input"<<endl;
    cout<<"1.int\n2.float\n3.double\n";
    int choose;
    cin>>choose;
    cout<<"How many number you want to enter:"<<endl;
    int n;
    cin>>n;
    if ( choose == 1)
    {
        int* p =new int[n];
        for (int i = 0; i < n; i++)
        {
            cin>>p[i];
            sort(p,n);
        }
    }
    if ( choose == 2)
    {
        float* p =new float[n];
        for (int i = 0; i < n; i++)
        {
            cin>>p[i];
            sort(p,n);
        }
    }
    if ( choose == 3)
    {
        double* p =new double[n];
        for (int i = 0; i < n; i++)
        {
            cin>>p[i];
            sort(p,n);
        }
    }
}

void sort(int* p,int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (p[i]>p[j])
            {
                int temp;
                temp=p[j];
                p[j]=p[i];
                p[i]=temp;
            }   
        }   
    }
    for (int k = 0; k < n; k++)
    {
        cout<<p[k]<<" ";
    }
}

void sort(float* p,int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (p[i]>p[j])
            {
                int temp;
                temp=p[j];
                p[j]=p[i];
                p[i]=temp;
            }   
        }   
    }
    for (int k = 0; k < n; k++)
    {
        cout<<p[k]<<" ";
    }
}

void sort(double* p,int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (p[i]>p[j])
            {
                int temp;
                temp=p[j];
                p[j]=p[i];
                p[i]=temp;
            }   
        }   
    }
    for (int k = 0; k < n; k++)
    {
        cout<<p[k]<<" ";
    }
}